---

components:
  llm:
    init_parameters:
      api_base_url: null
      api_key:
        env_vars:
        - OPENAI_API_KEY
        strict: true
        type: env_var
      generation_kwargs: {}
      model: gpt-3.5-turbo
      streaming_callback: null
      system_prompt: null
    type: haystack.components.generators.openai.OpenAIGenerator

  prompt_builder:
    init_parameters:
      template: |
      {% raw %}
        "Given these documents, answer the question.
        Documents:
        {% for doc in documents %}\
        {{ doc.content }}
        {% endfor %}
        Question: {{query}}

        Answer:"
      {% endraw %}
    type: haystack.components.builders.prompt_builder.PromptBuilder

  retriever:
    init_parameters:
      document_store:
        init_parameters:
          bm25_tokenization_regex: (?u)\b\w\w+\b
          bm25_algorithm: BM25L
          bm25_parameters: {}
          embedding_similarity_function: dot_product
          index: documents
        type: haystack.document_stores.in_memory.document_store.InMemoryDocumentStore
      filters: null
      top_k: 10
    type: haystack.components.retrievers.in_memory.embedding_retriever.InMemoryEmbeddingRetriever

  text_embedder:
    init_parameters:
      api_base_url: null
      api_key:
        env_vars:
        - OPENAI_API_KEY
        strict: true
        type: env_var
      dimensions: null
      model: text-embedding-ada-002
      organization: null
      prefix: ''
      suffix: ''
    type: haystack.components.embedders.openai_text_embedder.OpenAITextEmbedder

connections:
- receiver: retriever.query_embedding
  sender: text_embedder.embedding
- receiver: prompt_builder.documents
  sender: retriever.documents
- receiver: llm.prompt
  sender: prompt_builder.prompt

metadata: {}
